package com.cmict.data.system.service.portal;

import com.cmict.data.framework.common.pojo.PageResult;
import com.cmict.data.system.controller.admin.portal.vo.PortalPageReqVO;
import com.cmict.data.system.dal.dataobject.portal.PortalVersionDO;
import com.cmict.data.system.dal.mysql.portal.PortalVersionMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import javax.annotation.Resource;

/**
 * 门户 Service 实现类
 *
 * @author awesome
 */
@Service
@Validated
@Slf4j
public class PortalVersionServiceImpl implements PortalVersionService {

    @Resource
    private PortalVersionMapper portalVersionMapper;

    @Override
    public Long createPortal(PortalVersionDO createReqVO) {
        portalVersionMapper.insert(createReqVO);
        // 返回
        return createReqVO.getId();
    }

    @Override
    public PageResult<PortalVersionDO> getPortalPage(PortalPageReqVO pageReqVO) {
        return portalVersionMapper.selectPage(pageReqVO);
    }

    @Override
    public PortalVersionDO getPortal(Long id) {
        return portalVersionMapper.selectById(id);
    }

}
